#ifndef REGISTERWIDGET_H
#define REGISTERWIDGET_H

#include <QWidget>
#include "usermanager.h"
#include "databasemanager.h"

namespace Ui {
class RegisterWidget;
}

class RegisterWidget : public QWidget
{
    Q_OBJECT

public:
    explicit RegisterWidget(QWidget *parent = nullptr);
    ~RegisterWidget();

    void setUserManager(UserManager* userManager);

signals:
    void display(int);
    void sendMessage(const QString&);

private slots:
    void onRegisterBtnClicked();

private:
    Ui::RegisterWidget *ui;
    UserManager *m_pUserManager;
    void clearInputFields();
    void handleRegisterError(UserManager::UserError error);
};

#endif // REGISTERWIDGET_H
